<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      div{
        width: 500px;
        height: 500px;
        border: 1px solid black;
      }
    </style>
    <title></title>
  </head>
  <body>
    <div id="app">
      <p>{{num}}</p>
      <!-- <p @click.prevent.self=fun1>
        <button @click=fun2>点击</button>
      </p> -->
      <p @click=fun1>
        <a href="http://baidu.com" @click.stop.prevent=fun2>点击</a>
      </p>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm=new Vue({
        el:'#app',
        data:{num:0},
        methods:{
          fun1(){
            this.num++
          },
          fun2(){
            this.num++
          }
        },
       })
    </script>
  </body>
</html>